package com.yf.tz.vo.down;


import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;

import java.math.BigDecimal;

import com.yf.tz.entity.MallOrderEntity;

import com.yf.tz.enums.MallOrderPaidEnum;
import com.yf.tz.enums.MallOrderOrderStatusEnum;
import com.yf.tz.enums.MallOrderPayWayEnum;

/**
 * 订单实体
 * 表名 mall_order
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Jul 29 10:58:33 CST 2020
 */
@Data
public class MallOrderDown implements Serializable {
    private static final long serialVersionUID = 1L;

    //ID
    @ExcelProperty("ID")
    private Long id;

    //价格
    @ExcelProperty("价格")
    private BigDecimal price;

    //积分
    @ExcelProperty("积分")
    private BigDecimal point;

    //实际支付
    @ExcelProperty("实际支付")
    private BigDecimal pay;

    //ENUM-是否支付:"NO-否","YES-是"
    private Integer paid;
    @ExcelProperty("是否支付")
    private String paidStr;

    //订单时间
    @ExcelProperty("订单时间")
    private Date orderTime;

    //支付时间
    @ExcelProperty("支付时间")
    private Date payTime;

    //发货时间
    @ExcelProperty("发货时间")
    private Date sendTime;

    //ENUM-订单状态:"NEW-新订单","DELIVERING-配货中","DELIVERED-已发货"
    private Integer orderStatus;
    @ExcelProperty("订单状态")
    private String orderStatusStr;

    //省
    @ExcelProperty("省")
    private String province;

    //市
    @ExcelProperty("市")
    private String city;

    //县
    @ExcelProperty("县")
    private String county;

    //详细地址
    @ExcelProperty("详细地址")
    private String detail;

    //手机号
    @ExcelProperty("手机号")
    private String phone;

    //收货人
    @ExcelProperty("收货人")
    private String name;

    //物流公司
    @ExcelProperty("物流公司")
    private String logCompany;

    //用户ID
    @ExcelProperty("用户ID")
    private Long userId;

    //ENUM-支付方式:"WX-微信","CEC-电子币"
    private Integer payWay;
    @ExcelProperty("支付方式")
    private String payWayStr;

    //物流费
    @ExcelProperty("物流费")
    private BigDecimal logFee;

    //物流费
    @ExcelProperty("银行卡号")
    private String bankInfo;

    //
    @ExcelProperty("")
    private String orderNo;

    //物流单号
    @ExcelProperty("物流单号")
    private String logNo;


    public MallOrderDown() {

    }

    public MallOrderDown(MallOrderEntity entity) {
        this.setId(entity.getId());

        this.setPrice(entity.getPrice());

        this.setPoint(entity.getPoint());

        this.setPay(entity.getPay());

        this.setPaid(entity.getPaid());
        this.setPaidStr( MallOrderPaidEnum.indexOf(entity.getPaid()));

        this.setOrderTime(entity.getOrderTime());

        this.setPayTime(entity.getPayTime());

        this.setSendTime(entity.getSendTime());

        this.setOrderStatus(entity.getOrderStatus());
        this.setOrderStatusStr( MallOrderOrderStatusEnum.indexOf(entity.getOrderStatus()));

        this.setProvince(entity.getProvince());

        this.setCity(entity.getCity());

        this.setCounty(entity.getCounty());

        this.setDetail(entity.getDetail());

        this.setPhone(entity.getPhone());

        this.setName(entity.getName());

        this.setLogCompany(entity.getLogCompany());

        this.setUserId(entity.getUserId());

        this.setPayWay(entity.getPayWay());
        this.setPayWayStr( MallOrderPayWayEnum.indexOf(entity.getPayWay()));

        this.setLogFee(entity.getLogFee());

        this.setOrderNo(entity.getOrderNo());

        this.setLogNo(entity.getLogNo());

    }


}
